<template>
	<view class="padb30">
		<cu-custom bgColor="bg-gradual-blue" isBack>
			<block slot="content">我的订单</block>
			<block slot="backText">返回</block>
		</cu-custom>
		<view class="flrc bg-white ripple" @tap="$win.navto"
		data-url="/pages/stream/createOrder/createOrder">
			<view class="wh30-30 flcc">
				<text class="fa fa-file-text fa-4x"></text>
			</view>
			<view class="flex1">
				<view class="fs14">创建新订单</view>
				<view>创建、审核、排产、交付</view>
			</view>
			<view class="fa fa-angle-right pad3"></view>
		</view>
		<view class="mart3">
			<view class="list-style-1">订单列表</view>
		</view>
		<view>
			<view class="bcf round5 shadow1 marlr3 pad2 mart3" v-for="(item,index) in list" :key="index">
				<view class="flrc padtb1 bdbso" :data-id="item.id" @tap="$win.goto('/pages/stream/orderEdit/orderInfo',$event)">
					<view class="flex1">{{item.sn}}</view>
					<view class=" tar padlr3 padtb1 round1 bdso" :style="'background-color: ' + item.status.background + ';color: ' + item.status.color + ';'">
						{{item.status.name}}
					</view>
					<text class="fa fa-angle-right padl3"></text>
				</view>
				<view class="flex-r flex-start c12 padb3">
					<view class="wh30-30 mart3 marr2">
						<image @tap="viewPic($api.getAssetBaseUrl() + item.cover,[$api.getAssetBaseUrl() + item.cover])" 
						:src="$api.getAssetBaseUrl() + item.cover" class="wh30-30" mode="aspectFill"></image>
					</view>
					<view class="flex1 lh15 fs8 tar">
						<view class="flex1 c11 lh2 fs14 fwb">{{item.info}}</view>
						<view>创建：{{$com.str2time(item.createAt)}}</view>
						<view>开工：{{$com.str2time(item.startAt)}}</view>
						<view>完成：{{$com.str2time(item.finishAt)}}</view>
					</view>
				</view>
				<view class="bdtso pad3">
					{{item.tips}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from '../../../static/js/api.js'
	import com from '../../../static/js/com.js'
	import win from '../../../static/js/win.js'
	import list from '../../../static/js/list.js'
	export default {

		data() {
			return {
				list: []
			}
		},
		methods: {

			createOrder() {

			}
		},
		created() {

		},
		onShow() {
			
			let _this = this
			list.setUrl('/api/my/streamOrders')
			list.setData({})
			list.setCbFunc((res) => {
				uni.stopPullDownRefresh();
				console.log(res)
				this.list = res
			})
			list.reload()
			
		},
		onReachBottom() {
			list.getList()
		},
		onPullDownRefresh() {
			list.reload()
		}
	}
</script>

<style>

</style>
